const dictHelp = {
    // 服务
    service: {url: 'logistics/service/list', props: {label: 'name', value: 'id'}, translation: true,},
    // 部门
    dept: {url: 'system/dept/list', props: {label: 'name', value: 'id'}, translation: true,},
    // 员工
    user: {url: 'system/user/list', props: {label: 'nickname', value: 'id'}, translation: true,},
    // 货站
    depot: {url: 'warehouse/depot/list', props: {label: 'name', value: 'id'}, translation: true,},
    depotSea: {url: 'warehouse/depot/list?sea=1', props: {label: 'name', value: 'id'}, translation: true,},
    depotPrice: {url: 'warehouse/depot/list?sea=1&fedex_account_id=1', props: {label: 'name', value: 'id'}, translation: true,},
    depotAll: {url: 'warehouse/depot/list?all=1', props: {label: 'name', value: 'id'}, translation: true,},
    // 用户等级
    customerGrade: {url: 'customers/customerGrade/list', props: {label: 'name', value: 'id'}, translation: true,},
    // 供应商服务
    supplier_service: {url: 'logistics/supplierService/list', props: {label: 'name', value: 'id'}, translation: true,},
    // 提单列表
    waybill: {
        url: 'document/waybill/list', props: {
            label: (row) => {
                return row.public_number + ' - ' + row.number + ''
            }, value: 'id'
        }, translation: true,
    },
    waybillShouldSelect: {
        url: 'document/waybill/list', params: {
            scene: 'distribution'
        }, props: {
            label: (row) => {
                console.log(row)
                return row.public_number + 
                        ' - ' + row.number + 
                        ' - ' + (row.shipping_schedule ? (row.shipping_schedule.first_leg_transport ? row.shipping_schedule.first_leg_transport.name : '') : '')+ 
                        ' - ' + (row.statistics.length ? row.statistics[0].volume : 0) + 'm³'  +
                        ' - ' + (row.statistics.length ? row.statistics[0].weight : 0) + 'kg'  +
                        ' - ' + row.close_at  
            }, value: 'id'
        }, translation: true,
    },
    customer: {url: 'customers/customer/list', props: {label: 'nick', value: 'id'}, params:{select:'id,username,nick'},translation: true,},
    addressLibDetail: {url:'logistics/addressLibDetail/list',props: {label: 'name', value: 'id'},translation: true},
    supplier_service_with_type: (value) => {
        return {
            url: 'logistics/supplierService/list?type=' + value,
            props: {label: 'name', value: 'id'},
            translation: true,
        };
    },
    // 船期
    shipping_schedule: {url: 'document/shippingSchedule/list', props: {label: 'name', value: 'id'}, translation: true,},
    shipping_schedule_with_type: (type) => {
        return {
            url: 'document/shippingSchedule/list?type=' + type,
            props: {label: 'name', value: 'id'},
            translation: true,
        };
    },

    // 港口/车站
    place: {url: 'logistics/place/list', props: {label: 'name', value: 'id'}, translation: true,},
    place_with_type(value) {
        return {url: 'logistics/place/list?type=' + value, props: {label: 'name', value: 'id'}, translation: true,}
    },
    // 清关代理
    supplier_clearance: {
        url: 'logistics/supplier/list?type[]=8',
        props: {label: 'name', value: 'id'},
        translation: true,
    },
    // 报关代理
    supplier_declare: {
        url: 'logistics/supplier/list?type[]=7',
        props: {label: 'name', value: 'id'},
        translation: true,
    },
    firstLegTransportation: {
        url: 'document/firstLegTransportation/list',
        props: {
            label: 'name',
            value: 'id'
        },
        translation: true
    },
    waybillServiceType: {
        url: 'sea/waybillServiceType/list',
        props: {
            label: 'name',
            value: 'id'
        },
        translation: true
    },
    area: {
        url: 'warehouse/area/list',
        props: {
            label: 'name',
            value: 'id'
        },
        translation: true
    },
    clientPermissions: {
        url: 'user/adminPermissions/list',
        translation: true
    },
    delivery: {
        url: 'warehouse/delivery/list',
        props: {
            label: (record) => {
                // 展示箱数,重量,出发地仓库目的仓库,参考号
                let volume = (record?.volume_weight?.volume ?? 0) + '立方'
                let weight = (record?.volume_weight?.weight ?? 0) + 'kg'
                let parcel_count = (record?.volume_weight?.parcel_count ?? 0) + '箱'
                let reference = record.reference
                let address = record.from_depot?.name + '至' + (record.to_depot_id == 999999 ? '外部转运':record.to_depot?.name)
                return `${reference??''} ${parcel_count} ${volume} ${weight} ${address}`
            },
            value: 'id',
        },
        translation: true
    },
    // 供应商
    supplier:(type)=>{
        return {url: 'logistics/supplier/list?type='+type, props: {label: 'name', value: 'id'}, translation: true,}
    },
    supplierApi:()=>{
        return {url: 'logistics/supplier/supplierApi', props: {label: 'name', value: 'id'}, translation: true,}
    },
    channelDadan:{url: 'logistics/supplier/listDadan', props: {label: 'label', value: 'value'}, translation: true,},
    firstLegTransportationWithType: (type) => {
        return {
            url: 'document/supplierChannel/list?type=' + type,
            props: {label: 'name', value: 'id'},
            translation: true,
        };
    },
    tags:(type)=>{
        return {
            url: 'logistics/tag/list',
            props: {label: 'name', value: 'id'},
            params: {select: 'id,name,color',type:type},
            translation: true, 
        }    
    },
    waybillChildren:(parent_id)=>{
        return {
            url: 'document/waybill/list?parent_id='+parent_id,
            props: {
                label: (row) => {
                    return row.public_number + ' - ' + row.number + ''
                }, value: 'id'
            },
            translation: true, 
        }    
    }
}

export default dictHelp
